Cisco Packet Tracer Extensions API 8.1.0
API for communication between Cisco Packet Tracer application and its extension applications and modules.
Public Member Functions | List of all members
MacSwitch Class Reference

MacSwitch handles and manipulates the MAC address table. More...

Inheritance diagram for MacSwitch:
Process

Public Member Functions

bool addStaticMac (mac, int, string)
 Adds a static MAC address to the specified port. More...
 
bool removeStaticMac (mac, int, string)
 Removes the static MAC address from the specified port. More...
 
int getStaticMacCount ()
 Returns the number of static MAC addresses configured. More...
 
StaticMac getGlobalMacAt (int)
 Returns the static MAC address at the specified index. More...
 
bool portExistedInStatic (string)
 
bool isEntryExisted (mac, int, string)
 Returns true if the specified entry exists in the MAC address table, otherwise false. More...
 
void updateTableEvent ()
 Event triggered when the table is updated. More...
 
void closeTableEvent ()
 Event triggered when the table is closed/deleted. More...
 
- Public Member Functions inherited from Process
Device getOwnerDevice ()
 Returns the device for this process. More...
 

Detailed Description

MacSwitch handles and manipulates the MAC address table.

Member Function Documentation

◆ addStaticMac()

bool MacSwitch::addStaticMac ( mac  ,
int  ,
string   
)

Adds a static MAC address to the specified port.

Parameters
macAddress,thestatic MAC address.
vlanNumber,theVLAN number.
portName,portNamecan be one of the following plus a port number where appropriate: Console, Aux, Ethernet, FastEthernet, GigabitEthernet, Serial, Wireless, Loopback, Vlan, Modem, Coaxial, Rs232, Async. Example: FastEthernet0/0
Returns
bool, true if successful, otherwise false.

◆ closeTableEvent()

void MacSwitch::closeTableEvent ( )

Event triggered when the table is closed/deleted.

IPC event.

◆ getGlobalMacAt()

StaticMac MacSwitch::getGlobalMacAt ( int  )

Returns the static MAC address at the specified index.

Parameters
index,theindex of the static MAC address of interest.
Returns
StaticMac, the StaticMac object at the specified index.

◆ getStaticMacCount()

int MacSwitch::getStaticMacCount ( )

Returns the number of static MAC addresses configured.

Returns
int, the number of static MAC addresses configured.

◆ isEntryExisted()

bool MacSwitch::isEntryExisted ( mac  ,
int  ,
string   
)

Returns true if the specified entry exists in the MAC address table, otherwise false.

Parameters
macAddress,thestatic MAC address of interest.
vlanNumber,theVLAN number of interest.
portName,portNamecan be one of the following plus a port number where appropriate: Console, Aux, Ethernet, FastEthernet, GigabitEthernet, Serial, Wireless, Loopback, Vlan, Modem, Coaxial, Rs232, Async. Example: FastEthernet0/0
Returns
bool, true if the specified entry exists in the MAC address table, otherwise false.

◆ portExistedInStatic()

bool MacSwitch::portExistedInStatic ( string  )
Parameters
Returnstrue if the specified port has a static MAC address, otherwise false.
portName,portNamecan be one of the following plus a port number where appropriate: Console, Aux, Ethernet, FastEthernet, GigabitEthernet, Serial, Wireless, Loopback, Vlan, Modem, Coaxial, Rs232, Async. Example: FastEthernet0/0
Returns
bool, true if the specified port has a static MAC address, otherwise false.

◆ removeStaticMac()

bool MacSwitch::removeStaticMac ( mac  ,
int  ,
string   
)

Removes the static MAC address from the specified port.

Parameters
macAddress,thestatic MAC address of interest.
vlanNumber,theVLAN number of interest.
portName,portNamecan be one of the following plus a port number where appropriate: Console, Aux, Ethernet, FastEthernet, GigabitEthernet, Serial, Wireless, Loopback, Vlan, Modem, Coaxial, Rs232, Async. Example: FastEthernet0/0
Returns
bool, true if successful, otherwise false.

◆ updateTableEvent()

void MacSwitch::updateTableEvent ( )

Event triggered when the table is updated.

IPC event.


The documentation for this class was generated from the following file: